This application claims priority to and depends upon Provisional Application No. 62/235,502, filed on Sep. 30, 2015 and entitled, “System and Method for Using Ubershader Variants Without Preprocessing Macros,” such Provisional Application being hereby incorporated by reference in its entirety.
The inventions disclosed herein relate to the field of graphics processing and, without limitation, systems and methods that include the development and use of ubershaders and variants thereof without the use of pre-processing macros.
Graphics processing units (GPUs) have become important for processing data-parallel graphics tasks. Developers now recognize that non-graphics data-parallel tasks can also be handled by GPUs, taking advantage of their massive parallel capabilities. Vendors and standards organizations have created application programming interfaces (APIs) that make graphics data-parallel tasks easier to program because of the high level of developer programming interaction. There are also low-level APIs (or libraries/frameworks etc.) that reside closer to hardware and are generally employed by applying the output of the higher-level APIs. In other words, the higher-level APIs generally simply prepare program code for application to the lower-level APIs.
GPUs commonly use programs called shader programs or shaders. One common example of a shader, is a program that operates on a pixel of graphics (or the computational equivalent). One way to write shaders is to code selectable features or properties in the code, so that different executable programs may be derived from the same shader source code. This type of shader program is commonly called an ubershader. Ubershaders are convenient because they allow many programing options to be implemented all in one shader. However, the art relating to Ubershaders may be improved.